package org.dant.ant.extension.tasks;

import java.io.File;
import java.util.*;

import org.apache.tools.ant.types.Environment;
import org.dant.ant.extension.types.Expect;

public class RemoteExecutable extends RemoteTask {
    protected File dir;
    protected String dirstring;
  
    protected boolean blocking;
    protected boolean unique;
    protected int duplicate = 1;
    protected Environment env = new Environment();

    protected List expectlist = new LinkedList();

    protected boolean share;
  
    public void setShare(boolean s) {
        this.share = s;
    }
  
    public boolean getShare() {
        return this.share;
    }

    public File getDir() {
        return dir;
    }
  
    public void setDir(String d) {
        dirstring = d;
        this.dir = getProject().resolveFile(d, getProject().getBaseDir());
    }

    public Expect createExpect() {
        Expect expect = new Expect();
    
        expectlist.add(expect);
        return expect;
    }

    public List getExpectedList() {
        return expectlist;
    }

    public void setUnique(boolean u) {
        this.unique = u;
    }

    public boolean getUnique() {
        return this.unique;
    }

    public void setDuplicate(int d) {
        this.duplicate = d;
    }

    public int getDuplicate() {
        return this.duplicate;
    }

    public void setBlocking(boolean b) {
        this.blocking = b;
    }

    public boolean getBlocking() {
        return this.blocking;
    }
    public void addEnv(Environment.Variable var) {
        env.addVariable(var);
    }

    public String[]  getEnviroment() {
        return env.getVariables();
    }
  

}
